unit Class_WGFL_D7;

interface
uses
  Classes,SysUtils,FireDAC.Stan.Intf, FireDAC.Stan.Option,
  FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
  FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.MSSQL,
  FireDAC.Phys.MSSQLDef, Data.DB, FireDAC.Comp.Client, FireDAC.Stan.Param,
  FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Comp.DataSet,
  FireDAC.VCLUI.Wait, FireDAC.Comp.UI;

type
  TWAGEFL=class(TObject)
  private
    FUNITLINK : string;
    FGZJGIDEX : Integer;
    FWAGEKJND : Integer;
    FWAGEKJQJ : Integer;
    FWAGEIDEX : Integer;
    FSTAFIDEX : Integer;
    FSTAFBDID : Integer;
    FSTAFTYPE : Integer;
    FSTAFBANK : string;
    FSTAFNUMB : string;
    FWAGEGSND : Integer;
    FWAGEGSQJ : Integer;
    FGSNDGSQJ : Integer;
    FKJNDKJQJ : Integer;
    FHOLDTYPE : Integer;
    FISDEALED : Integer;
    FHOLDFROM : Integer;
    FISHOLDED : Integer;
  public
    FListData : TStringList;
  public
    function GetObjtIdentity:string;
  public
    destructor  Destroy; override;
    constructor Create;
  published
    property UNITLINK : string read FUNITLINK  write FUNITLINK;
    property GZJGIDEX : Integer read FGZJGIDEX  write FGZJGIDEX;
    property WAGEKJND : Integer read FWAGEKJND  write FWAGEKJND;
    property WAGEKJQJ : Integer read FWAGEKJQJ  write FWAGEKJQJ;
    property WAGEIDEX : Integer read FWAGEIDEX  write FWAGEIDEX;
    property STAFIDEX : Integer read FSTAFIDEX  write FSTAFIDEX;
    property STAFBDID : Integer read FSTAFBDID  write FSTAFBDID;
    property STAFTYPE : Integer read FSTAFTYPE  write FSTAFTYPE;
    property STAFBANK : string read FSTAFBANK  write FSTAFBANK;
    property STAFNUMB : string read FSTAFNUMB  write FSTAFNUMB;
    property WAGEGSND : Integer read FWAGEGSND  write FWAGEGSND;
    property WAGEGSQJ : Integer read FWAGEGSQJ  write FWAGEGSQJ;
    property GSNDGSQJ : Integer read FGSNDGSQJ  write FGSNDGSQJ;
    property KJNDKJQJ : Integer read FKJNDKJQJ  write FKJNDKJQJ;
    property HOLDTYPE : Integer read FHOLDTYPE  write FHOLDTYPE;
    property ISDEALED : Integer read FISDEALED  write FISDEALED;
    property HOLDFROM : Integer read FHOLDFROM  write FHOLDFROM;
    property ISHOLDED : Integer read FISHOLDED  write FISHOLDED;
  public
    class function  ReadDS(AUniQuery:TFDQuery):TWAGEFL;
  end;

implementation

{ TWAGEFL }

constructor TWAGEFL.Create;
begin
  FListData:=TStringList.Create;
end;

destructor TWAGEFL.Destroy;
begin
  if FListData<>nil then FreeAndNil(FListData);
  inherited;
end;

function TWAGEFL.GetObjtIdentity: string;
begin
  Result:=Format('%S-%D-%D-%D-%D-%D',[FUNITLINK,FGZJGIDEX,FWAGEKJND,FWAGEKJQJ,FWAGEIDEX,FSTAFIDEX]);
end;

class function TWAGEFL.ReadDS(AUniQuery:TFDQuery):TWAGEFL;
var
  I:Integer;
  TMPA:string;
  Field:TField;
begin
  Result:=TWAGEFL.Create;

  with TWAGEFL(Result) do
  begin
    UNITLINK :=AUniQuery.FieldByName('UNIT_LINK').AsString;
    GZJGIDEX :=AUniQuery.FieldByName('GZJG_IDEX').AsInteger;
    WAGEKJND :=AUniQuery.FieldByName('WAGE_KJND').AsInteger;
    WAGEKJQJ :=AUniQuery.FieldByName('WAGE_KJQJ').AsInteger;
    WAGEIDEX :=AUniQuery.FieldByName('WAGE_IDEX').AsInteger;
    STAFIDEX :=AUniQuery.FieldByName('STAF_IDEX').AsInteger;
    STAFBDID :=AUniQuery.FieldByName('STAF_BDID').AsInteger;
    STAFTYPE :=AUniQuery.FieldByName('STAF_TYPE').AsInteger;
    STAFBANK :=AUniQuery.FieldByName('STAF_BANK').AsString;
    STAFNUMB :=AUniQuery.FieldByName('STAF_NUMB').AsString;
    WAGEGSND :=AUniQuery.FieldByName('WAGE_GSND').AsInteger;
    WAGEGSQJ :=AUniQuery.FieldByName('WAGE_GSQJ').AsInteger;
    GSNDGSQJ :=AUniQuery.FieldByName('GSND_GSQJ').AsInteger;
    KJNDKJQJ :=AUniQuery.FieldByName('KJND_KJQJ').AsInteger;
    HOLDTYPE :=AUniQuery.FieldByName('HOLD_TYPE').AsInteger;
    ISDEALED :=AUniQuery.FieldByName('IS_DEALED').AsInteger;
    HOLDFROM :=AUniQuery.FieldByName('HOLD_FROM').AsInteger;
    ISHOLDED :=AUniQuery.FieldByName('IS_HOLDED').AsInteger;

    {for I := 0 to 119 do
    begin
      TMPA:=Format('FIELD%D',[I+1]);
      FListData.Add(AUniQuery.FieldByName(TMPA).AsString);
    end;}
  end;
end;


end.

